.class public Lcom/facebook/orca/ops/OrcaServiceOperation;
.super Ljava/lang/Object;
.source "OrcaServiceOperation.java"


# instance fields
.field private final a:Landroid/content/Context;

.field private final b:Lcom/facebook/orca/ops/OrcaServiceOperation$OrcaServiceConnection;

.field private final c:Landroid/os/Handler;

.field private d:Lcom/facebook/orca/server/IOrcaService;

.field private e:Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;

.field private f:Lcom/facebook/orca/ops/OrcaServiceOperation$OnProgressListener;

.field private g:Z

.field private h:Z

.field private i:Z

.field private j:Lcom/facebook/orca/ops/OperationProgressIndicator;

.field private k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

.field private l:Ljava/lang/String;

.field private m:Landroid/os/Bundle;

.field private n:Ljava/lang/String;

.field private o:Z

.field private p:Z

.field private q:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/os/Handler;)V
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 132
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 107
    sget-object v0, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->INIT:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    .line 133
    iput-object p1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->a:Landroid/content/Context;

    .line 134
    new-instance v0, Lcom/facebook/orca/ops/OrcaServiceOperation$OrcaServiceConnection;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/facebook/orca/ops/OrcaServiceOperation$OrcaServiceConnection;-><init>(Lcom/facebook/orca/ops/OrcaServiceOperation;Lcom/facebook/orca/ops/OrcaServiceOperation$1;)V

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->b:Lcom/facebook/orca/ops/OrcaServiceOperation$OrcaServiceConnection;

    .line 135
    iput-object p2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->c:Landroid/os/Handler;

    .line 136
    return-void
.end method

.method static synthetic a(Lcom/facebook/orca/ops/OrcaServiceOperation;Lcom/facebook/orca/server/IOrcaService;)Lcom/facebook/orca/server/IOrcaService;
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 24
    iput-object p1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->d:Lcom/facebook/orca/server/IOrcaService;

    return-object p1
.end method

.method static synthetic a(Lcom/facebook/orca/ops/OrcaServiceOperation;Lcom/facebook/orca/server/OperationResult;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 24
    invoke-direct {p0, p1}, Lcom/facebook/orca/ops/OrcaServiceOperation;->a(Lcom/facebook/orca/server/OperationResult;)V

    return-void
.end method

.method private a(Lcom/facebook/orca/ops/ServiceException;)V
    .locals 2
    .parameter

    .prologue
    .line 524
    sget-object v0, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->COMPLETED:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    .line 525
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    .line 526
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->i()V

    .line 528
    const/4 v0, 0x0

    .line 529
    iget-object v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->a:Landroid/content/Context;

    instance-of v1, v1, Lcom/facebook/orca/activity/OrcaActivityish;

    if-eqz v1, :cond_0

    .line 530
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->a:Landroid/content/Context;

    check-cast v0, Lcom/facebook/orca/activity/OrcaActivityish;

    .line 531
    invoke-interface {v0, p1}, Lcom/facebook/orca/activity/OrcaActivityish;->a(Lcom/facebook/orca/ops/ServiceException;)Z

    move-result v0

    .line 534
    :cond_0
    iget-boolean v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->g:Z

    if-eqz v1, :cond_1

    .line 535
    invoke-virtual {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->d()V

    .line 537
    :cond_1
    if-nez v0, :cond_2

    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->e:Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;

    if-eqz v0, :cond_2

    .line 538
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->e:Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;

    invoke-virtual {v0, p1}, Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;->a(Lcom/facebook/orca/ops/ServiceException;)V

    .line 540
    :cond_2
    iget-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->h:Z

    if-eqz v0, :cond_3

    .line 541
    invoke-virtual {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->a()V

    .line 543
    :cond_3
    return-void
.end method

.method private a(Lcom/facebook/orca/server/OperationResult;)V
    .locals 1
    .parameter

    .prologue
    .line 489
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->f:Lcom/facebook/orca/ops/OrcaServiceOperation$OnProgressListener;

    if-eqz v0, :cond_0

    .line 490
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->f:Lcom/facebook/orca/ops/OrcaServiceOperation$OnProgressListener;

    invoke-virtual {v0, p1}, Lcom/facebook/orca/ops/OrcaServiceOperation$OnProgressListener;->a(Lcom/facebook/orca/server/OperationResult;)V

    .line 492
    :cond_0
    return-void
.end method

.method static synthetic a(Lcom/facebook/orca/ops/OrcaServiceOperation;)Z
    .locals 1
    .parameter

    .prologue
    .line 24
    iget-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->q:Z

    return v0
.end method

.method static synthetic a(Lcom/facebook/orca/ops/OrcaServiceOperation;Z)Z
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 24
    iput-boolean p1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->p:Z

    return p1
.end method

.method static synthetic b(Lcom/facebook/orca/ops/OrcaServiceOperation;)V
    .locals 0
    .parameter

    .prologue
    .line 24
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->f()V

    return-void
.end method

.method static synthetic b(Lcom/facebook/orca/ops/OrcaServiceOperation;Lcom/facebook/orca/server/OperationResult;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 24
    invoke-direct {p0, p1}, Lcom/facebook/orca/ops/OrcaServiceOperation;->b(Lcom/facebook/orca/server/OperationResult;)V

    return-void
.end method

.method private b(Lcom/facebook/orca/server/OperationResult;)V
    .locals 1
    .parameter

    .prologue
    .line 500
    invoke-virtual {p1}, Lcom/facebook/orca/server/OperationResult;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 501
    invoke-direct {p0, p1}, Lcom/facebook/orca/ops/OrcaServiceOperation;->c(Lcom/facebook/orca/server/OperationResult;)V

    .line 505
    :goto_0
    return-void

    .line 503
    :cond_0
    new-instance v0, Lcom/facebook/orca/ops/ServiceException;

    invoke-direct {v0, p1}, Lcom/facebook/orca/ops/ServiceException;-><init>(Lcom/facebook/orca/server/OperationResult;)V

    invoke-direct {p0, v0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->a(Lcom/facebook/orca/ops/ServiceException;)V

    goto :goto_0
.end method

.method static synthetic c(Lcom/facebook/orca/ops/OrcaServiceOperation;)Landroid/os/Handler;
    .locals 1
    .parameter

    .prologue
    .line 24
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->c:Landroid/os/Handler;

    return-object v0
.end method

.method private c(Lcom/facebook/orca/server/OperationResult;)V
    .locals 1
    .parameter

    .prologue
    .line 508
    sget-object v0, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->COMPLETED:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    .line 509
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    .line 510
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->i()V

    .line 512
    iget-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->g:Z

    if-eqz v0, :cond_0

    .line 513
    invoke-virtual {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->d()V

    .line 515
    :cond_0
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->e:Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;

    if-eqz v0, :cond_1

    .line 516
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->e:Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;

    invoke-virtual {v0, p1}, Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;->a(Lcom/facebook/orca/server/OperationResult;)V

    .line 518
    :cond_1
    iget-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->h:Z

    if-eqz v0, :cond_2

    .line 519
    invoke-virtual {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->a()V

    .line 521
    :cond_2
    return-void
.end method

.method private e()V
    .locals 4

    .prologue
    const/4 v3, 0x1

    .line 383
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->d:Lcom/facebook/orca/server/IOrcaService;

    if-eqz v0, :cond_1

    .line 386
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->f()V

    .line 399
    :cond_0
    :goto_0
    return-void

    .line 387
    :cond_1
    iget-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->o:Z

    if-nez v0, :cond_0

    .line 390
    new-instance v0, Landroid/content/Intent;

    iget-object v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->a:Landroid/content/Context;

    const-class v2, Lcom/facebook/orca/server/OrcaService;

    invoke-direct {v0, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 391
    iget-object v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->a:Landroid/content/Context;

    iget-object v2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->b:Lcom/facebook/orca/ops/OrcaServiceOperation$OrcaServiceConnection;

    invoke-virtual {v1, v0, v2, v3}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 392
    iput-boolean v3, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->o:Z

    goto :goto_0

    .line 394
    :cond_2
    sget-object v0, Lcom/facebook/orca/server/ErrorCode;->ORCA_SERVICE_IPC_FAILURE:Lcom/facebook/orca/server/ErrorCode;

    const-string v1, "Bind to OrcaService failed"

    invoke-static {v0, v1}, Lcom/facebook/orca/server/OperationResult;->a(Lcom/facebook/orca/server/ErrorCode;Ljava/lang/String;)Lcom/facebook/orca/server/OperationResult;

    move-result-object v0

    .line 396
    new-instance v1, Lcom/facebook/orca/ops/ServiceException;

    invoke-direct {v1, v0}, Lcom/facebook/orca/ops/ServiceException;-><init>(Lcom/facebook/orca/server/OperationResult;)V

    invoke-direct {p0, v1}, Lcom/facebook/orca/ops/OrcaServiceOperation;->a(Lcom/facebook/orca/ops/ServiceException;)V

    goto :goto_0
.end method

.method private f()V
    .locals 4

    .prologue
    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 407
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->READY_TO_QUEUE:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-ne v0, v1, :cond_4

    .line 408
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->l:Ljava/lang/String;

    if-eqz v0, :cond_1

    move v0, v3

    :goto_0
    const-string v1, "Null operation type"

    invoke-static {v0, v1}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/Object;)V

    .line 409
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    if-nez v0, :cond_2

    move v0, v3

    :goto_1
    const-string v1, "Non-null operation id"

    invoke-static {v0, v1}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/Object;)V

    .line 410
    iget-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->p:Z

    if-nez v0, :cond_3

    move v0, v3

    :goto_2
    const-string v1, "Registered for competion and haven\'t yet sent"

    invoke-static {v0, v1}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/Object;)V

    .line 414
    :try_start_0
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->d:Lcom/facebook/orca/server/IOrcaService;

    iget-object v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->l:Ljava/lang/String;

    iget-object v2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->m:Landroid/os/Bundle;

    invoke-interface {v0, v1, v2}, Lcom/facebook/orca/server/IOrcaService;->a(Ljava/lang/String;Landroid/os/Bundle;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    .line 415
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->g()V

    .line 416
    sget-object v0, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->OPERATION_QUEUED:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 436
    :cond_0
    :goto_3
    return-void

    :cond_1
    move v0, v2

    .line 408
    goto :goto_0

    :cond_2
    move v0, v2

    .line 409
    goto :goto_1

    :cond_3
    move v0, v2

    .line 410
    goto :goto_2

    .line 417
    :catch_0
    move-exception v0

    .line 418
    sget-object v0, Lcom/facebook/orca/server/ErrorCode;->ORCA_SERVICE_IPC_FAILURE:Lcom/facebook/orca/server/ErrorCode;

    const-string v1, "OrcaService.<method> or registerCompletionHandler failed"

    invoke-static {v0, v1}, Lcom/facebook/orca/server/OperationResult;->a(Lcom/facebook/orca/server/ErrorCode;Ljava/lang/String;)Lcom/facebook/orca/server/OperationResult;

    move-result-object v0

    .line 421
    new-instance v1, Lcom/facebook/orca/ops/ServiceException;

    invoke-direct {v1, v0}, Lcom/facebook/orca/ops/ServiceException;-><init>(Lcom/facebook/orca/server/OperationResult;)V

    invoke-direct {p0, v1}, Lcom/facebook/orca/ops/OrcaServiceOperation;->a(Lcom/facebook/orca/ops/ServiceException;)V

    goto :goto_3

    .line 423
    :cond_4
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->OPERATION_QUEUED:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-ne v0, v1, :cond_0

    .line 424
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    if-eqz v0, :cond_5

    move v0, v3

    :goto_4
    const-string v1, "null operation id"

    invoke-static {v0, v1}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/Object;)V

    .line 425
    iget-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->p:Z

    if-nez v0, :cond_0

    .line 427
    :try_start_1
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->g()V
    :try_end_1
    .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_3

    .line 428
    :catch_1
    move-exception v0

    .line 429
    sget-object v0, Lcom/facebook/orca/server/ErrorCode;->ORCA_SERVICE_IPC_FAILURE:Lcom/facebook/orca/server/ErrorCode;

    const-string v1, "OrcaService.registerCompletionHandler failed"

    invoke-static {v0, v1}, Lcom/facebook/orca/server/OperationResult;->a(Lcom/facebook/orca/server/ErrorCode;Ljava/lang/String;)Lcom/facebook/orca/server/OperationResult;

    move-result-object v0

    .line 432
    new-instance v1, Lcom/facebook/orca/ops/ServiceException;

    invoke-direct {v1, v0}, Lcom/facebook/orca/ops/ServiceException;-><init>(Lcom/facebook/orca/server/OperationResult;)V

    invoke-direct {p0, v1}, Lcom/facebook/orca/ops/OrcaServiceOperation;->a(Lcom/facebook/orca/ops/ServiceException;)V

    goto :goto_3

    :cond_5
    move v0, v2

    .line 424
    goto :goto_4
.end method

.method private g()V
    .locals 3

    .prologue
    .line 444
    iget-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->i:Z

    if-eqz v0, :cond_0

    .line 481
    :goto_0
    return-void

    .line 447
    :cond_0
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->d:Lcom/facebook/orca/server/IOrcaService;

    iget-object v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    new-instance v2, Lcom/facebook/orca/ops/OrcaServiceOperation$1;

    invoke-direct {v2, p0}, Lcom/facebook/orca/ops/OrcaServiceOperation$1;-><init>(Lcom/facebook/orca/ops/OrcaServiceOperation;)V

    invoke-interface {v0, v1, v2}, Lcom/facebook/orca/server/IOrcaService;->a(Ljava/lang/String;Lcom/facebook/orca/server/ICompletionHandler;)Z

    move-result v0

    .line 473
    if-eqz v0, :cond_1

    .line 474
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->p:Z

    goto :goto_0

    .line 476
    :cond_1
    sget-object v0, Lcom/facebook/orca/server/ErrorCode;->ORCA_SERVICE_IPC_FAILURE:Lcom/facebook/orca/server/ErrorCode;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Unknown operation: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/facebook/orca/server/OperationResult;->a(Lcom/facebook/orca/server/ErrorCode;Ljava/lang/String;)Lcom/facebook/orca/server/OperationResult;

    move-result-object v0

    .line 479
    new-instance v1, Lcom/facebook/orca/ops/ServiceException;

    invoke-direct {v1, v0}, Lcom/facebook/orca/ops/ServiceException;-><init>(Lcom/facebook/orca/server/OperationResult;)V

    invoke-direct {p0, v1}, Lcom/facebook/orca/ops/OrcaServiceOperation;->a(Lcom/facebook/orca/ops/ServiceException;)V

    goto :goto_0
.end method

.method private h()V
    .locals 1

    .prologue
    .line 546
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->j:Lcom/facebook/orca/ops/OperationProgressIndicator;

    if-eqz v0, :cond_0

    .line 547
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->j:Lcom/facebook/orca/ops/OperationProgressIndicator;

    invoke-interface {v0}, Lcom/facebook/orca/ops/OperationProgressIndicator;->a()V

    .line 549
    :cond_0
    return-void
.end method

.method private i()V
    .locals 1

    .prologue
    .line 552
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->j:Lcom/facebook/orca/ops/OperationProgressIndicator;

    if-eqz v0, :cond_0

    .line 553
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->j:Lcom/facebook/orca/ops/OperationProgressIndicator;

    invoke-interface {v0}, Lcom/facebook/orca/ops/OperationProgressIndicator;->b()V

    .line 555
    :cond_0
    return-void
.end method


# virtual methods
.method public a()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 142
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->q:Z

    .line 143
    iget-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->o:Z

    if-eqz v0, :cond_0

    .line 144
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->a:Landroid/content/Context;

    iget-object v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->b:Lcom/facebook/orca/ops/OrcaServiceOperation$OrcaServiceConnection;

    invoke-virtual {v0, v1}, Landroid/content/Context;->unbindService(Landroid/content/ServiceConnection;)V

    .line 145
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->o:Z

    .line 147
    :cond_0
    iput-object v2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->d:Lcom/facebook/orca/server/IOrcaService;

    .line 148
    iput-object v2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->f:Lcom/facebook/orca/ops/OrcaServiceOperation$OnProgressListener;

    .line 149
    iput-object v2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->e:Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;

    .line 150
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->i()V

    .line 151
    return-void
.end method

.method public a(Landroid/os/Bundle;)V
    .locals 2
    .parameter

    .prologue
    .line 160
    const-string v0, "operationState"

    iget-object v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putSerializable(Ljava/lang/String;Ljava/io/Serializable;)V

    .line 161
    const-string v0, "type"

    iget-object v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->l:Ljava/lang/String;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 162
    const-string v0, "param"

    iget-object v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->m:Landroid/os/Bundle;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putParcelable(Ljava/lang/String;Landroid/os/Parcelable;)V

    .line 163
    const-string v0, "operationId"

    iget-object v1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    invoke-virtual {p1, v0, v1}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    .line 164
    return-void
.end method

.method public a(Lcom/facebook/orca/ops/OperationProgressIndicator;)V
    .locals 2
    .parameter

    .prologue
    .line 280
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->READY_TO_QUEUE:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->OPERATION_QUEUED:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-ne v0, v1, :cond_1

    .line 282
    :cond_0
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->i()V

    .line 284
    :cond_1
    iput-object p1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->j:Lcom/facebook/orca/ops/OperationProgressIndicator;

    .line 285
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->READY_TO_QUEUE:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-eq v0, v1, :cond_2

    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->OPERATION_QUEUED:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-ne v0, v1, :cond_3

    .line 287
    :cond_2
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->h()V

    .line 289
    :cond_3
    return-void
.end method

.method public a(Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;)V
    .locals 0
    .parameter
        .annotation runtime Ljavax/annotation/Nullable;
        .end annotation
    .end parameter

    .prologue
    .line 244
    iput-object p1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->e:Lcom/facebook/orca/ops/OrcaServiceOperation$OnCompletedListener;

    .line 245
    return-void
.end method

.method public a(Lcom/facebook/orca/ops/OrcaServiceOperation$OnProgressListener;)V
    .locals 0
    .parameter

    .prologue
    .line 262
    iput-object p1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->f:Lcom/facebook/orca/ops/OrcaServiceOperation$OnProgressListener;

    .line 263
    return-void
.end method

.method public a(Ljava/lang/String;Landroid/os/Bundle;)V
    .locals 4
    .parameter
    .parameter

    .prologue
    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 367
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->INIT:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-ne v0, v1, :cond_0

    move v0, v3

    :goto_0
    const-string v1, "Incorrect operation state"

    invoke-static {v0, v1}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/Object;)V

    .line 368
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->l:Ljava/lang/String;

    if-nez v0, :cond_1

    move v0, v3

    :goto_1
    const-string v1, "Non-null opreation type"

    invoke-static {v0, v1}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/Object;)V

    .line 369
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    if-nez v0, :cond_2

    move v0, v3

    :goto_2
    const-string v1, "Non-null param"

    invoke-static {v0, v1}, Lcom/google/common/base/Preconditions;->checkState(ZLjava/lang/Object;)V

    .line 371
    sget-object v0, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->READY_TO_QUEUE:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    .line 372
    iput-object p1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->l:Ljava/lang/String;

    .line 373
    iput-object p2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->m:Landroid/os/Bundle;

    .line 374
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->h()V

    .line 375
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->e()V

    .line 376
    return-void

    :cond_0
    move v0, v2

    .line 367
    goto :goto_0

    :cond_1
    move v0, v2

    .line 368
    goto :goto_1

    :cond_2
    move v0, v2

    .line 369
    goto :goto_2
.end method

.method public a(Z)V
    .locals 0
    .parameter

    .prologue
    .line 306
    iput-boolean p1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->g:Z

    .line 307
    return-void
.end method

.method public b(Landroid/os/Bundle;)V
    .locals 2
    .parameter

    .prologue
    .line 172
    const-string v0, "operationState"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getSerializable(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v0

    check-cast v0, Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    .line 173
    const-string v0, "param"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v0

    check-cast v0, Landroid/os/Bundle;

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->m:Landroid/os/Bundle;

    .line 174
    const-string v0, "type"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->l:Ljava/lang/String;

    .line 175
    const-string v0, "operationId"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    .line 177
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->INIT:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-ne v0, v1, :cond_1

    .line 191
    :cond_0
    :goto_0
    return-void

    .line 179
    :cond_1
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->READY_TO_QUEUE:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-ne v0, v1, :cond_2

    .line 181
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->h()V

    .line 182
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->e()V

    goto :goto_0

    .line 183
    :cond_2
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->OPERATION_QUEUED:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-ne v0, v1, :cond_3

    .line 186
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->h()V

    .line 187
    invoke-direct {p0}, Lcom/facebook/orca/ops/OrcaServiceOperation;->e()V

    goto :goto_0

    .line 188
    :cond_3
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->COMPLETED:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-ne v0, v1, :cond_0

    goto :goto_0
.end method

.method public b(Z)V
    .locals 0
    .parameter

    .prologue
    .line 324
    iput-boolean p1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->h:Z

    .line 325
    return-void
.end method

.method public b()Z
    .locals 2

    .prologue
    .line 199
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->INIT:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->COMPLETED:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-eq v0, v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public c()Lcom/facebook/orca/ops/OrcaServiceOperation$State;
    .locals 1

    .prologue
    .line 208
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    return-object v0
.end method

.method public c(Z)V
    .locals 0
    .parameter

    .prologue
    .line 344
    iput-boolean p1, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->i:Z

    .line 345
    return-void
.end method

.method public d()V
    .locals 4

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x0

    .line 351
    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->INIT:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    sget-object v1, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->COMPLETED:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    if-ne v0, v1, :cond_1

    :cond_0
    const/4 v0, 0x1

    :goto_0
    invoke-static {v0}, Lcom/google/common/base/Preconditions;->checkState(Z)V

    .line 352
    sget-object v0, Lcom/facebook/orca/ops/OrcaServiceOperation$State;->INIT:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    iput-object v0, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->k:Lcom/facebook/orca/ops/OrcaServiceOperation$State;

    .line 353
    iput-object v2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->l:Ljava/lang/String;

    .line 354
    iput-object v2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->m:Landroid/os/Bundle;

    .line 355
    iput-object v2, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->n:Ljava/lang/String;

    .line 356
    iput-boolean v3, p0, Lcom/facebook/orca/ops/OrcaServiceOperation;->p:Z

    .line 357
    return-void

    :cond_1
    move v0, v3

    .line 351
    goto :goto_0
.end method
